Image processing apparatus, image processing method, and image system

ABSTRACT

An image processing apparatus detecting a plurality of joint positions between a plurality of input images includes a target image generation unit configured to generate a plurality of target images to be searched in a second input image among the input images from a first input image among the input images; a characteristic amount calculation unit configured to calculate a characteristic amount for each of the target images generated by the target image generation unit; and a matching calculation unit configured to calculate a matching between the target image of interest among the target images having the characteristic amounts calculated by the characteristic amount calculation unit, and a part of the second input image, using an evaluation method depending on the characteristic amounts calculated by the characteristic amount calculation unit.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation application filed under 35 U.S.C.111(a) claiming the benefit under 35 U.S.C. 120 and 365(c) of a PCTInternational Application No. PCT/JP2014/072850 filed on Aug. 25, 2014,which is based upon and claims the benefit of priority of the priorJapanese Patent Application No. 2013-177176 filed on Aug. 28, 2013, andthe prior Japanese Patent Application No. 2013-177197 filed on Aug. 28,2013, with the Japanese Patent Office, the entire contents of which arehereby incorporated by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The disclosures herein generally relate to an image processingapparatus, an image processing method, and an imaging system, morespecifically, an image processing apparatus, an image processing method,and an imaging system that piece multiple input images together.

2. Description of the Related Art

An entire celestial sphere imaging system has been known that usesmultiple wide-angle lenses such as fisheye lenses or superwide-anglelenses to capture an omniazimuth (referred to as “entire celestialsphere” below) image at once. The entire celestial sphere imaging systemgenerates an entire celestial sphere image by projecting images from thelenses onto sensor surfaces and piecing the images together by imageprocessing. It is possible to generate such an entire celestial sphereimage by using, for example, two wide-angle lenses having field anglesgreater than 180°.

In the image processing, distortion correction and projective transformare applied to partial images captured by the lens optical systems,based on a predetermined projection model and considering distortionfrom an ideal model. Then, the partial images are pieced together usingoverlapped parts included in the partial images, to generate a singleentire celestial sphere image. In the process of piecing the imagestogether, joint positions of overlapped objects are detected by usingpattern matching in the overlapped parts of the partial images.

However, for the conventional joint position detection technology usingpattern matching, it is difficult to detect appropriate joint positionsif a region to be matched is a flat image or has few characteristicswhere the same pattern is repeated. Therefore, the partial images cannotfavorably be pieced together, which may reduce the quality of theobtained entire celestial sphere image.

Various technologies have been known that piece captured multiplepartial images together using multiple cameras. For example, JapaneseLaid-open Patent Publication No. 2001-148779 (Patent Document 1)discloses an image processing apparatus that has an object to synthesizean image with high precision by avoiding an error of pattern matchingcaused when an inappropriate matching region is used when performing thepattern matching. The conventional technology in Patent Document 1 isconfigured to determine whether a matching region extracted by amatching region extraction unit is appropriate, and if the matchingregion is inappropriate, to execute extraction again. It is alsoconfigured to determine whether a matching result by a pattern matchingunit is appropriate, and if the matching result is not appropriate, toexecute extraction of a matching region again.

To improve precision of image synthesis, the conventional technology inPatent Document 1 removes in advance regions inappropriate as matchingregions, for example, a region of all white pixels or black pixels, or aregion including a continuous line in the vertical direction, thelateral direction, or an oblique direction before performing patternmatching.

However, the conventional technology in Patent Document 1 is atechnology that executes extraction of a matching region again if amatching region is inappropriate. Therefore, it is still difficult todetermine an appropriate joint position for a matching region that isdetermined as inappropriate.

RELATED-ART DOCUMENTS Patent Documents

[Patent Document 1] Japanese Laid-open Patent Publication No.2001-148779

SUMMARY OF THE INVENTION

According to at least one embodiment of the present invention, an imageprocessing apparatus detecting a plurality of joint positions between aplurality of input images includes a target image generation unitconfigured to generate a plurality of target images to be searched in asecond input image among the input images from a first input image amongthe input images; a characteristic amount calculation unit configured tocalculate a characteristic amount for each of the target imagesgenerated by the target image generation unit; and a matchingcalculation unit configured to calculate a matching between the targetimage of interest among the target images having the characteristicamounts calculated by the characteristic amount calculation unit, and apart of the second input image, using an evaluation method depending onthe characteristic amounts calculated by the characteristic amountcalculation unit.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a cross-sectional view of an entire celestial sphere imagingsystem according to a first embodiment of the present invention;

FIG. 2 is a hardware configuration diagram of the entire celestialsphere imaging system according to the first embodiment;

FIG. 3 is a flow of overall image processing in the entire celestialsphere imaging system according to the first embodiment;

FIG. 4 is a functional block diagram of main blocks in an entirecelestial sphere image synthesis process implemented in the entirecelestial sphere imaging system according to the first embodiment;

FIG. 5 is a flowchart of the entire celestial sphere image synthesisprocess as a whole executed by the entire celestial sphere imagingsystem according to the first embodiment;

FIGS. 6A-6B are diagrams illustrating a projection relationship in theentire celestial sphere imaging system using fisheye lenses;

FIGS. 7A-7B are diagrams illustrating a data structure of image data inan entire celestial sphere image format used in the first embodiment;

FIGS. 8A-8B are diagrams illustrating conversion data that is referredto by a distortion correction unit for position detection and adistortion correction unit for image synthesis;

FIG. 9 is a diagram illustrating a mapping of two partial images onto aspherical coordinate system where the images are captured by two fisheyelenses during a position detection process;

FIG. 10 is a functional block diagram of a joint position detection unitaccording to the first embodiment;

FIGS. 11A-11D are diagrams of a template characteristic amountcalculation unit according to a specific embodiment;

FIG. 12 is a flowchart of a joint position detection process executed bythe entire celestial sphere imaging system according to the firstembodiment;

FIG. 13 is a diagram illustrating a generation method of a templateimage by a template generation unit according to the first embodiment;

FIG. 14A is a diagram illustrating ordering of template images accordingto the first embodiment; and FIGS. 14B-14C are diagrams a calculationmethod of temporary positions of template images based on the orderingexecuted by a temporary position calculation unit according to the firstembodiment;

FIGS. 15A-15C are diagrams illustrating a setting method of a searchrange executed by a search range setting unit according to the firstembodiment;

FIG. 16A illustrates a template image; and FIG. 16B illustrates aprocess of searching for a template image in a search range by patternmatching;

FIG. 17A illustrates a graph of an offset function; and FIGS. 17B-17Cillustrate graphs of scores before correction and scores aftercorrection plotted with search positions, along with matching positionsbased on scores before correction and matching positions based on scoresafter correction;

FIG. 18 is a diagram illustrating a data structure of detection resultdata generated by a joint position detection unit according to the firstembodiment;

FIGS. 19A-19B are diagrams illustrating a process to generate detectionresult data by a joint position detection unit according to the firstembodiment;

FIG. 20 is a flowchart of a generation process of a conversion table forimage synthesis executed by the entire celestial sphere imaging systemaccording to the first embodiment;

FIG. 21 is a diagram illustrating a mapping of two partial images onto aspherical coordinate system where the images are captured by two fisheyelenses during an image synthesis process;

FIG. 22 is an overall view of the entire celestial sphere imaging systemaccording to a second embodiment;

FIG. 23 is a flowchart of an entire celestial sphere image synthesisprocess as a whole executed by the entire celestial sphere imagingsystem according to the second embodiment; and

FIG. 24A illustrates a matching calculation process; and FIG. 24Billustrates a score correction process executed by the entire celestialsphere imaging system according to the first embodiment.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

In the following, a first embodiment of the present invention will bedescribed with reference to the drawings. Note that embodiments of thepresent invention are not limited to the present embodiment described inthe following. As an example of an image processing apparatus and animaging system, the present embodiment will be described using an entirecelestial sphere imaging system 10 that includes an imaging unit whoseoptical system has two fisheye lenses, and an image processing functionto generate an entire celestial sphere image by applying distortioncorrection and projective transform to two partial images captured bythe fisheye lenses, and piecing the images together.

[Overall Configuration]

In the following, a whole configuration of the entire celestial sphereimaging system 10 will be described according to the present embodimentwith reference to FIGS. 1-3. FIG. 1 is a cross-sectional view of theentire celestial sphere imaging system (simply referred to as the“imaging system” below) 10 according to the present embodiment. Theimaging system 10 illustrated in FIG. 1 includes an imaging unit 12, ahousing 14 to hold parts such as the imaging unit 12, a controller, abattery, and a shutter button 18 disposed on the housing 14. The imagingunit 12 illustrated in FIG. 1 includes two imaging forming opticalsystems 20A and 20B, and two solid-state image sensing devices 22A and22B such as CCD (Charge Coupled Device) sensors or CMOS (ComplementaryMetal Oxide Semiconductor) sensors. A combination of one imaging formingoptical system 20 and one solid-state image sensing device 22 isreferred to as an imaging optical system. Each of the imaging formingoptical systems 20 may be constituted with, for example, a six-groupseven-lens fisheye lens. In the example illustrated in FIG. 1, thefisheye lens has an overall field angle of greater than 180° (=360°/nwhere n=2), preferably the field angle of greater than 185°, or evenpreferably the field angle of greater than 190°.

The optical elements (the lens, prism, filter, and aperture diaphragm)of the imaging forming optical systems 20A-20B are positioned relativeto the solid-state image sensing devices 22A-22B. The positions aredetermined so that the optical axis of the optical elements of theimaging forming optical systems 20A-20B is positioned perpendicular tothe center parts of the light reception regions of the correspondingsolid-state image sensing devices 22, and the light reception regionsare positioned coincident with the imaging forming planes of thecorresponding fisheye lenses. Each of the solid-state image sensingdevices 22 is a two-dimensional solid-state image sensing device inwhich the light reception region occupies the area through which lightcollected by the combined imaging forming optical system 20 is convertedinto an image signal.

In the example illustrated in FIG. 1, the imaging forming opticalsystems 20A-20B have the same specification, and can be combined in thedirection reverse to each other by having their optical axes coincidentwith each other. The solid-state image sensing devices 22A-22B convertlight distribution of received light into image signals, and output thesignals to an image processing unit of a controller (not illustrated).The image processing unit, which will be described later in detail,pieces together partial images input from the solid-state image sensingdevices 22A-22B to synthesize and generate an image having a solid angleof 4π radian (referred to as an “entire celestial sphere image” below).The entire celestial sphere image is a captured image that can be viewedfrom an imaging point in all directions. Note that, in the exampleillustrated in FIG. 1, although the entire celestial sphere image isgenerated, it may be a what-is-called “panoramic image” that captures a360° view only in horizontal directions.

Also note that by making the scanning directions of the solid-stateimage sensing devices 22A-22B equivalent to each other, the capturedimages can be pieced together more easily. Namely, making the scanningdirections and order at a part to be pieced together equivalent to eachother for the solid-state image sensing devices 22A-22B is effective topiece together an object, especially a moving object, at a boundary ofcameras. For example, if an upper left part of a captured image capturedby the solid-state image sensing device 22A coincides with a lower-leftpart of a captured image captured by the solid-state image sensingdevice 22B as parts to be pieced together as an image, the solid-stateimage sensing device 22A scans the image from top to bottom, and fromright to left of the solid-state image sensing device 22A. On the otherhand, the solid-state image sensing device 22B scans the image frombottom to top, and from right to left of the solid-state image sensingdevice 22B. In this way, by controlling the scanning directions of thesolid-state image sensing devices to be coincident with each other basedon parts of an image to be pieced together, an effect is obtained thatthe images can be pieced together more easily.

As described above, the fisheye lens has the overall field angle greaterthan 180°. Therefore, an overlapped part of a captured image in each ofthe imaging optical systems is referred to as reference datarepresenting the same image when piecing the images together to generatean entire celestial sphere image. The generated entire celestial sphereimage is output to an external recording medium disposed in the imagingunit 12, or connected with the imaging unit 12, for example, a displaydevice, a print device, an SD (trademark) card, or a Compact Flash(trademark) memory.

FIG. 2 is a hardware configuration diagram of the entire celestialsphere imaging system 10 according to the present embodiment. Theimaging system 10 is configured with a digital still camera processor(simply referred to as a “processor” below) 100, a lens barrel unit 102,and various components connected with the processor 100. The lens barrelunit 102 includes two sets of the lens optical systems 20A-20B and thesolid-state image sensing devices 22A-22B as described above. Thesolid-state image sensing device 22 is controlled by control commandsfrom a CPU 130 in the processor 100 as will be described later.

The processor 100 includes ISPs (Image Signal Processors) 108, DMACs(Direct Memory Access Controllers) 110, an arbiter (ARBMEMC) 112 toarbitrate memory access, an MEMC (Memory Controller) 114 to controlmemory access, and a distortion correction/image synthesis block 118.The ISPs 108A-108B apply white balance setting and gamma setting toinput image data having signal processing applied by the solid-stateimage sensing devices 22A-22B, respectively. The MEMC 114 is connectedwith an SDRAM 116. The SDRAM 116 temporarily stores data when applying aprocess in the ISPs 108A-180B and the distortion correction/imagesynthesis block 118. The distortion correction/image synthesis block 118synthesizes an image by applying a distortion correction and atop-bottom correction to two partial images obtained from the twoimaging optical systems, using information from a triaxial accelerationsensor 120.

The processor 100 further includes a DMAC 122, an image processing block124, a CPU 130, an image data transfer unit 126, an SDRAMC 128, a memorycard control block 140, an USB block 146, a peripheral block 150, avoice unit 152, a serial block 158, an LCD (Liquid Crystal Display)driver 162, and a bridge 168.

The CPU 130 controls operations of the units of the imaging system 10.The image processing block 124 applies various image processing to imagedata using a resize block 132, a JPEG block 134, and an H.264 block 136.The resize block 132 is a block to enlarge or reduce the size of imagedata by an interpolation process. The JPEG block 134 is a codec block toperform JPEG compression and expansion. The H.264 block 136 is a codecblock to perform moving picture compression and expansion such as H.264.The image data transfer unit 126 transfers an image having imageprocessing applied at the image processing block 124. The SDRAMC 128controls an SDRAM 138 that is connected with the processor 100, totemporarily store image data in the SDRAM 138 when applying variousprocesses to the image data in the processor 100.

The memory card control block 140 controls read/write to a memory cardinserted into a memory card slot 142, and a flash ROM 144. The memorycard slot 142 is a slot to attach/detach a memory card to/from theimaging system 10. The USB block 146 controls USB communication with anexternal device such as a personal computer that is connected via a USBconnector 148. The peripheral block 150 is connected with a power switch166. A voice unit 152 is connect with a microphone 156 for a user toinput a voice signal, a loudspeaker 154 to output a recorded voicesignal to control voice sound input/output. The serial block 158controls serial communication with an external device such as a personalcomputer, and is connected with a wireless NIC (Network Interface Card)160. The LCD driver 162 is a drive circuit to drive an LCD monitor 164,and converts signals for displaying various states on the LCD monitor164.

The flash ROM 144 stores a control program described in a decodable codefor the CPU 130 and various parameters. When the power source becomes anon-state due to an operation of the power switch 166, the controlprogram is loaded into a main memory. Following the program read in themain memory, the CPU 130 controls operations of the units of the device,and temporarily stores data required for the control in the SDRAM 138and a local SRAM (not illustrated).

FIG. 3 is a flow of overall image processing in the entire celestialsphere imaging system 10 according to the present embodiment. First, atSteps S101A and 101B, images are captured by the solid-state imagesensing devices 22A-22B, respectively. At Steps S102A and 102B, each ofthe ISPs 108 illustrated in FIG. 2 applies an optical black correctionprocess, a faulty pixel correction process, a linear correction process,a shading process, and a region partition and average process to BayerRAW images output from the solid-state image sensing devices 22A-22B. AtSteps S103A and 103B, the images are stored in the memory. At StepsS104A and 104B, each of the ISPs 108 illustrated in FIG. 2 furtherapplies a white balance process, a gamma correction process, a Bayerinterpolation process, a YUV conversion process, an edge reinforcementprocess, and a color correction process to the image, which is stored inthe memory at Steps S105A and 105B.

Upon completion of the processes at the two solid-state image sensingdevices 22A-22B, the partial images having the processes applied aretreated with a distortion correction and a synthesis process at StepS106. At Step S107, an entire celestial sphere image is stored as a filein a built-in memory or an external storage, having an appropriate tagattached. Also, during the distortion correction and the synthesisprocess, an inclination and top-bottom correction may be applied byobtaining information from the triaxial acceleration sensor 120 ifappropriate. Also, the stored image file may have a compression processapplied if appropriate.

[Entire Celestial Sphere Image Synthesis Functions]

In the following, entire celestial sphere image synthesis functions ofthe imaging system 10 will be described in detail according to thepresent embodiment with reference to FIGS. 4-21. FIG. 4 is a functionalblock diagram 200 of main blocks in an entire celestial sphere imagesynthesis process implemented in the entire celestial sphere imagingsystem 10 according to the present embodiment. As illustrated in FIG. 4,the distortion correction/image synthesis block 118 is configured toinclude a distortion correction unit for position detection 202, a jointposition detection unit 204, a table correction unit 206, a tablegeneration unit 208, a distortion correction unit for image synthesis210, and an image synthesis unit 212.

Also, the distortion correction/image synthesis block 118 receives twopartial images as input from the two solid-state image sensing devices22A-22B after having image signal processing applied at the ISPs108A-108B, respectively. Note that the number “0” or “1” is attached todistinguish an image from the solid-state image sensing device 22A or22B: an image having the solid-state image sensing device 22A as thesource is referred to as an “partial image 0”; and an image having thesolid-state image sensing device 22B as the source is referred to as an“partial image 1”. Moreover, the distortion correction/image synthesisblock 118 is provide with a conversion table for position detection 220that has been generated beforehand at a manufacturer or the like, basedon design data or the like of the respective lens optical systems, andfollowing a predetermined projection model.

The distortion correction unit for position detection 202 appliesdistortion correction to the input partial image 0 and partial image 1using the conversion table for position detection 220 as a preprocess ofa joint position detection process, to generate a corrected image forposition detection (also simply referred to as a “corrected image”below) 0 and a corrected image for position detection 1. The inputpartial images 0-1 are captured by the solid-state image sensing devicesin which the light reception regions occupy the areas, respectively,which are image data represented by a plane coordinate system (x, y). Onthe other hand, corrected images having distortion correction applied byusing the conversion table for position detection 220 are image datarepresented by a coordinate system different from that of the inputimages, or more specifically, the image data of an entire celestialsphere image format represented by a spherical coordinate system (apolar coordinate system having a radius vector of 1 and two arguments θand φ)).

FIGS. 6A-6B are diagrams illustrating a projection relationship in animaging system using fisheye lenses. In the present embodiment, an imagecaptured by a fisheye lens covers a hemisphere azimuth from an imagingpoint. Also, as illustrated in FIGS. 6A-6B, the fisheye lens generatesan image having the image height h that corresponds to an incident angleφ relative to the optical axis. The relationship between the imageheight h and the incident angle φ is determined by a projection functiondepending on a predetermined projection model. Although the projectionfunction depends on properties of a fisheye lens, for a fisheye lensrepresented by a projection model called an “equidistant projectionmethod”, it is represented by Formula (1) below where f represents afocal distance.

h=f×φ  (1)

Other projection models include a center projection method (h=f·tan φ),a stereographic projection method (h=2f·tan (φ/2)), an equi-solid-angleprojection method (h=2f·sin(φ/2)), and an orthogonal projection method(h=f·sin φ). In any of these methods, the image height h of imagingforming is determined corresponding to the incident angle φ from theoptical axis and the focal distance f. Also, in the present embodiment,a configuration of a so-called “circumferential fisheye lens” is adoptedwhere the image circle diameter is smaller than the image diagonal line,with which the partial image is obtained as a plane image that includesthe image circle as a whole on which almost a hemisphere of the capturedrange is projected as illustrated in FIG. 6B.

FIGS. 7A-7B are diagrams illustrating a data structure of image data inthe entire celestial sphere image format used in the present embodiment.As illustrated FIGS. 7A-7B, the image data in the entire celestialsphere image format is represented by an array of pixel values havingcoordinates of a vertical angle φ that corresponds to an angle relativeto a predetermined axis, and a horizontal angle θ that corresponds to arotation angle around the axis. The horizontal angle θ is represented inthe range of 0 to 360° (or −180° to +180°), and the vertical angle φ isrepresented in the range of 0 to 180° (or −90° to)+90°. Every pair ofcoordinates values (θ, φ) is associated with a point on the sphericalsurface representing omniazimuth having the imaging point as the center,and the omniazimuth is mapped onto the entire celestial sphere image.The relationship between plane coordinates of an image captured by thefisheye lens, and coordinates on the spherical surface in the entirecelestial sphere image format can be associated with each other using aprojection function as described in FIGS. 6A-6B.

FIGS. 8A-8B illustrate conversion data that is referred to by thedistortion correction unit for position detection 202 and the distortioncorrection unit for image synthesis 210. Each of the conversion tables220 and 224 specifies a projection from a partial image represented bythe plane coordinate system to an image represented by the sphericalcoordinate system. As illustrated in FIGS. 8A-8B, the conversion tables220 and 224 each hold, for each of the fisheye lenses, informationassociating coordinates values (θ, φ) of a corrected image withcoordinates values (x, y) of a partial image before correction to bemapped to the coordinates values (θ, φ), for every pair of coordinatesvalues (θ, φ) (θ=0, . . . , 360°, φ=0, . . . , 180°). In the example inFIGS. 8A-8B, one pixel covers an angle of 1/10° both in the φ directionand the θ direction. Therefore, each of the conversion tables 220 and224 has information of 3600×1800 associations for each of the fisheyelenses.

The conversion table for position detection 220 used for joint positiondetection has been calculated and generated in a table format beforehandat the manufacturer or the like, based on design data of the lens or thelike, and using the projection relationship of the lens described inFIGS. 6A-6B to correct distortion from an ideal lens model due to radialdistortion, eccentric distortion, and the like. In contrast to this, theconversion table for image synthesis 224 is generated from theconversion table for position detection 220 by a predeterminedconversion process as will be described later in detail. Note that, inthe present embodiment, conversion data is assumed to be data in whichan associative relationship of coordinates values is described in atabular form. However, other embodiments may use, as conversion data,coefficient data of one or more functions that specify a projection froma partial image (x, y) represented by a plane coordinate system to animage (θ, φ) represented by a spherical coordinate system.

Referring to FIG. 4 again, the distortion correction unit for positiondetection 202 refers to the conversion table for position detection 220,converts the partial image 0 and partial image 1, and generates thecorrected image for position detection and the corrected image forposition detection 1. More specifically, the distortion correction unitfor position detection 202 refers to the conversion table for positiondetection 220 for all coordinates (θ, φ) in the corrected image afterconversion, obtains coordinates (x, y) of a partial image beforeconversion to be mapped to the coordinates (θ, φ), to refer to a pixelvalue at the coordinates (x, y) in the partial image. In this way, acorrected image is generated.

FIG. 9 is a diagram illustrating a mapping of two partial images ontothe spherical coordinate system where the images are captured by the twofisheye lenses during a position detection process. As a result of theprocess by the distortion correction unit for position detection 202,the two partial images 0-1 captured by the fisheye lenses are expandedon the entire celestial sphere image format as illustrated in FIG. 9.The partial image 0 captured by the fisheye lens 0 is typically mappedonto about the upper hemisphere of the entire celestial sphere, and thepartial image 0 captured by the fisheye lens 1 is mapped onto about thelower hemisphere of the entire celestial sphere. The corrected image 0and the corrected image 1 represented in the entire celestial sphereformat overflow the respective hemispheres because the fisheye lenseshave the overall field angles greater than 180°. Consequently, whensuperposing the corrected image 0 and the corrected image 1, anoverlapped region is generated where captured ranges are overlappedbetween the images.

As will be described later in detail, after correction by the distortioncorrection unit for position detection 202, joint positions betweenimages are detected in the overlapped region by the joint positiondetection unit 204. The conversion table for position detection 220 inthe present embodiment is created so that, as illustrated in FIG. 9, theoptical axes of the two lens optical systems are projected to two poles(φ=0° or 180°) of the spherical surface, the overlapped region betweenthe images is projected in the neighborhood of the equator(φ=90°±((overall field angle −180°/2)) of the spherical surface. In thespherical coordinate system, when the vertical angle φ is closer to thepole at 0° or 180°, the distortion becomes greater and the precision ofjoint position detection is degraded. On the other hand, by using theprojection described above, joint position detection is performed byhaving the overlapped region positioned in the neighborhood of thevertical angle of 90° where the distortion amount is small when shiftedin the θ direction, with which the precision of joint position detectioncan be improved. In addition, joint positions can be detected with highprecision even for an image captured by a lens optical system havinggreat distortion.

Referring to FIG. 4 again, the joint position detection unit 204receives the corrected images 0 and 1 as input, which have beenconverted by the distortion correction unit for position detection 202,and detects joint positions between the input corrected images 0 and 1by using a pattern matching process to generate detection result data222.

When performing pattern matching, it is typically difficult to detectjoint positions with high precision if the region to be matched has aflat image, or it is a region where the same pattern is repeated withfew characteristics. Thereupon, the joint position detection unit 204 inthe present embodiment measures a characteristic amount that indicates adegree of characteristics held by the image of a region to be matched,and adopts a configuration to determine joint positions of the targetregion that uses the measured characteristic amount. This aims atimproving the quality of an obtained entire celestial sphere image.

FIG. 10 is a functional block diagram of the joint position detectionunit 204 illustrated in FIG. 4 in according to the present embodiment.In detail, the joint position detection unit 204 illustrated in FIG. 10is configured to include a template generation unit 232, a templatecharacteristic amount calculation unit 234, a template ordering unit236, a temporary position calculation unit 238, a search range settingunit 240, a matching calculation unit 242, a score correction unit 244,a joint position determination unit 246, and a detection resultgeneration unit 248. In the following description of a joint positiondetection process using template matching, it is assumed for the sake ofexplanation that the corrected image for position detection 1 is atemplate image, the corrected image for position detection 0 is a searchimage.

Using the corrected image for position detection 1 as a template imagein template matching, the template generation unit 232 generatesmultiple images to be searched for (referred to as “template images”) inthe search image from the corrected image for position detection 1. Inthe joint position detection process by template matching, a jointposition in the corrected image for position detection 0 is obtained foreach of the template images which are parts of the corrected image forposition detection 1. Note that an object here is to obtain jointpositions in the overlapped region between the corrected images 0 and 1.Therefore, multiple template images are generated from the overlappedregion of the corrected image for position detection 1.

The template characteristic amount calculation unit 234 calculates acharacteristic amount for each of the multiple template images generatedby the template generation unit 232. The characteristic amount here is avalue to quantitatively indicate a degree of characteristics held by atemplate image. In the present embodiment, a greater characteristicamount means that the image has a greater characteristic, whereas asmaller characteristic amount means that the image has a lesscharacteristic with no individuality. As the characteristic amount, oneof the edge amount extracted from a template image, and dispersion andstandard deviation calculated from the template image may be used, butit not specifically limited to these.

FIGS. 11A-11D are diagrams of a template characteristic amountcalculation unit according to a specific embodiment. FIGS. 11A-11Cillustrate a configuration of the template characteristic amountcalculation unit 234A according to an embodiment using the edge amountas the indicator. On the other hand, FIG. 11D illustrates aconfiguration of a template characteristic amount calculation unit 234Baccording to an embodiment using standard deviation or dispersion as theindicator.

When using the edge amount as the characteristic amount of a templateimage, an edge reinforcement block can be used for performing edgereinforcement as illustrated in FIG. 11A. The edge reinforcement blockillustrated in FIG. 11A is configured to include an edge detectionfilter unit 250, a gain multiplication unit 252, and an LPF (Low-PassFilter) unit 254. In the edge reinforcement block, the edge amountextracted at the edge detection filter unit 250 is multiplied by gain atthe gain multiplication unit 252, to generate a signal having the edgeamount adjusted. Then, a signal obtained by adding the adjusted signaland a signal having noise removed by applying an LPF process to theinput signal at the LPF unit 254 by an adder 256 is output as the signalhaving edge reinforcement.

In the present embodiment, only edges need to be extracted. Therefore,for example, by using LPF coefficients illustrated in FIG. 11C, thesignal may be set to zero after having the LPF process applied, and theedge amount may be output that is extracted at the edge detection filterunit 250 using edge extraction filtering coefficients illustrated inFIG. 11B. By inputting a template image into the edge reinforcementblock illustrated in FIG. 11A, the edge amount of each pixel is output.As the characteristic amount of a template image, the sum of the edgeamounts of all pixels in the template may be used, or an average of theedge amounts may be used. A greater sum of the edge amounts of atemplate image means that the image includes a greater number oflocations where brightness changes discontinuously. Therefore, a flatimage typically has smaller edge amounts, and a smaller characteristicamount.

When using the standard deviation (or dispersion) as the characteristicamount of a template image, a configuration illustrated in FIG. 11D maybe used. A standard deviation (or dispersion) calculation unit 258illustrated in FIG. 11D obtains the standard deviation a (or dispersionσ²) of a template image by the following calculation Formula (2) whereN(=W pixels×H pixels) is the total number of pixels in the templateimage, and T(i, j) is the brightness at coordinates (i, j) of thetemplate image. Greater standard deviation (or dispersion) of thetemplate image means wider distribution of brightness in a histogram.Therefore, a flat image has typically narrower distribution ofbrightness of an image, and a smaller characteristic amount.

$\begin{matrix}{\sigma = \sqrt{\frac{\sum\limits_{j}{\sum\limits_{i}\left\{ {T\left( {i,j} \right)} \right\}^{2}}}{N} - \left\{ \frac{\sum\limits_{j}{\sum\limits_{i}{T\left( {i,j} \right)}}}{N} \right\}^{2}}} & (2)\end{matrix}$

Note that although standard deviation or dispersion is used as thecharacteristic amount of a template image in the above example, otherindicators may be calculated to be used for characterizing a templateimage, which include indicators based on the density histogram such askurtosis of a density histogram obtained from a template image(representing a degree of concentration of the distribution of thehistogram around the average value), skewness (representing a degree ofskewness of the form of the histogram from a symmetric form), or otherstatistical indicators such as contrast based on a difference statistic.Also, although the characteristic amount is calculated using brightnessin the above description, the characteristic amount may be calculatedfor each of RGB colors, and their sum may be used as the characteristicamount of a template image. The edge amount, standard deviation, anddispersion are preferably used as the characteristic amount because theycan be simply calculated from an object image with a low calculationcost and a favorable detection result. However, it is not limited tothese, but any indicator may be used as long as it indicates a degree ofthe characteristic held by an image.

Referring to FIG. 10 again, the template ordering unit 236 determinesprocessing order of multiple template images based on the characteristicamounts calculated at the template characteristic amount calculationunit 234, to specify a relative relationship of the characteristicamounts among the template images.

The temporary position calculation unit 238 selects a template image ofinterest among the multiple generated template images, and calculates atemporary position of the template image of interest that is used as areference in the template matching process as will be described later.Here, the temporary position is calculated based on the relativerelationship of the characteristic amounts between the template image ofinterest and each of the peripheral template images in the neighborhoodof the corrected image for position detection 1.

Template matching is a process to search for one of the template imagesto be searched for in the search image. If a region that may correspondto the template image is identified to a certain extent, the searchrange in the search image may be restricted. The search range settingunit 240 sets a search range for template matching based on the relativerelationship of the characteristic amounts between the template image ofinterest and each of the peripheral template images. Typically, apredetermined search range is set in the image 0 for position detection,around the temporary position calculated by the temporary positioncalculation unit 238. Also, the search range may be further narroweddown based on joint positions that have already been determined forother peripheral template images.

For the template image of interest, the matching calculation unit 242calculates matching between the template image of interest and parts inthe corrected image for position detection based on the calculatedtemporary position by typically using a template matching method. Whencalculating the matching, the template image is moved in the searchrange centered around the temporary position set by the search rangesetting unit 240, and matching score is calculated that is an evaluationvalue based on similarity of the images at positions.

For the template image of interest, the score correction unit 244executes an offset correction for the score based on the similarity ofthe images calculated by the matching calculation unit 242, toprioritize the score around the calculated temporary position. In thisway, the score is calculated that considers the temporary positioncalculated based on the relative relationship of the characteristicamounts between the template images.

The joint position determination unit 246 determines a joint position atwhich the corrected score in the corrected image for position detection0 is maximized for the template image of interest. The determined jointposition here is affected by the joint position of the peripheraltemplate image having a greater characteristic amount than the templateimage of interest.

When the processes by the temporary position calculation unit 238, thesearch range setting unit 240, the matching calculation unit 242, thescore correction unit 244, and the joint position determination unit 246are executed for the multiple template images, the joint positions areobtained in the corrected image for position detection 0 that correspondto the respective template images. Based on a data set of the jointpositions corresponding to the obtained template images, the detectionresult generation unit 248 calculates joint positions of pixels (θ, φ)in the entire celestial sphere format, and generates detection resultdata 222.

Referring to FIG. 4 again, based on the detection result data 222, thetable correction unit 206 applies a correction to the conversion tablefor position detection 220 prepared in advance, and transfers it to thetable generation unit 208. The table generation unit 208 generates theconversion table for image synthesis 224 from the conversion datacorrected by the table correction unit 206 based on rotationalcoordinate transformation.

As a preprocess of an image synthesis process, the distortion correctionunit for image synthesis 210 applies distortion correction to theoriginal partial image 0 and partial image 1 using the conversion tablefor image synthesis 224, and generates the corrected image for imagesynthesis 0 and the corrected image for image synthesis 1. The generatedcorrected image for image synthesis is represented by the sphericalcoordinate system, similarly to the corrected image for positiondetection. On the other hand, the coordinate axes are defineddifferently from those for the corrected image for position detectiondue to the rotational coordinate transformation. The image synthesisunit 212 synthesizes the obtained corrected image for image synthesis 0and corrected image for image synthesis 1, and generates a synthesizedimage in the entire celestial sphere image format. Note that the processexecuted by the joint position detection unit 204, the table correctionunit 206, the table generation unit 208, the distortion correction unitfor image synthesis 210, and the image synthesis unit 212 will bedescribed later in detail along with the description of the processflow.

The functional block 200 illustrated in FIG. 4 may further include adisplay image generation unit 214. The generated synthesized image isrepresented in the entire celestial sphere image format. Therefore, ifit is displayed as it is on a flat display device such as an LCDdisplay, the image is displayed distorted more when approaching thevertical angle 0° or 180°. The display image generation unit 214 is aunit to execute image processing to project an entire celestial sphereimage on a flat display device. The display image generation unit 214can execute conversion for a synthesized image in the entire celestialsphere image format, for example, from a spherical coordinate systeminto a plane coordinate system having a specific direction and aspecific field angle, and can execute a process to project it as animage in a specific viewing direction with a certain field anglespecified by a user.

[Flow of Entire Celestial Sphere Image Synthesis Process]

In the following, a flow of the entire celestial sphere image synthesisprocess will be described according to the present embodiment withreference to FIGS. 5, 12 and 20. FIG. 5 is a flowchart of the entirecelestial sphere image synthesis process as a whole executed by theimaging system 10 according to the present embodiment. The processillustrated in FIG. 5 starts at Step S200 in response to a commandissued at the CPU 130, for example, when the shutter button 18 ispressed to give an instruction of imaging by the two imaging opticalsystem.

At Step S201, the imaging system 10 has the distortion correction unitfor position detection 202 apply distortion correction to the partialimages 0 and 1 obtained by the two solid-state image sensing devices22A-22B, using the conversion table for position detection 220. Thus,the corrected image for position detection 0 and the corrected image forposition detection 1 are obtained. Namely, the corrected images areobtained in the entire celestial sphere image format illustrated in FIG.9. At Step S202, the imaging system 10 has the joint position detectionunit 204 execute joint position detection between the images inoverlapped regions of the corrected image for position detection 0 andthe corrected image for position detection 1.

FIG. 12 is a flowchart of the joint position detection process executedby the imaging system 10 according to the present embodiment. Theprocess illustrated in FIG. 12 is called at Step S202 illustrated inFIG. 5, and starts at Step S300. At Step S301, the imaging system 10executes initial setting for template images, a search image to besearched, the block size of the templates, generation start coordinatesof the templates, a generation interval, and the total number of blocks.

FIG. 13 is a diagram illustrating a generation method of a templateimage by the template generation unit 232 according to the presentembodiment. In the present embodiment, a template image 300 is an imageof a part of the overlapped region in the corrected image for positiondetection 1, and a search image 310 is an image of a part of theoverlapped region in the corrected image for position detection 0. Theblock size is the number of pixels that constitute a template image, andthe generation interval is an interval between generation of adjacenttemplate images. The generation start coordinates are coordinates of afirst template image to be cut off. Note that the block size and thegeneration interval may be determined by considering desired precisionand a processing amount for piecing images together.

Assuming that the block size is W pixels×H pixels, the generation startcoordinates are (sx, sy), and the generation interval is “step” pixels,multiple template images 302-1 to 302-# are generated as illustrated inFIG. 13. The number of blocks # of generated templates takes an integervalue obtained by dividing the horizontal directional size of thetemplate image 300 (the width of the entire celestial sphere format=3600pixels in the present embodiment) by the generation interval “step”.

For the multiple template images 302-1 to 302-# generated here,corresponding parts 314 in the search image 310 are searched for inpredetermined search ranges 312. Note that both ends in θ coordinates(at 0° and 360°) in the entire celestial sphere image format areconnected with each other. Therefore, when generating a template imageand executing template matching, a part beyond the right end can betreated as the left end, and a part beyond the left end can be treatedas the right end.

Referring to FIG. 12, template images are generated based on currentcoordinates (sx, sy) at Step S302. In a first time loop, a templateimage is generated by cutting off a region having the block size of (Wpixels×H pixels) at the generation start coordinates (sx, sy) initiallyset at Step S301. After the first template image has been generated, thecoordinates are updated to (sx+step, sy) for template generation forloops for a second time and after, and similarly, a region having theblock size at the updated coordinates is specified to generate nexttemplate images. When a template image is generated, the generatedtemplate image is assigned a template number (simply referred to as a“number”) as schematically illustrated in FIG. 13. Note that it is not arestriction, but it is assumed that template images are generated forone row in the overlapped region for one round in θ direction in thepresent embodiment.

At Step S303, the imaging system 10 calculates the templatecharacteristic amount from the template image generated at Step S302. AtStep S304, the imaging system 10 determines whether all blocks to begenerated have been processed. If it is determined that not all blocksto be generated have been processed (NO) at Step S304, the process loopsback to Step S302 to generate a next template image and to calculate itscharacteristic amount. On the other hand, if it is determined that allblocks to be generated have been processed (YES) at Step S304, theprocess branches to Step S305.

At Step S305, the imaging system 10 determines processing order of alltemplate images in descending order of the characteristic amount. Thus,the processing order is determined for Steps S306 and after. FIG. 14A isa diagram illustrating ordering of the template images according to thepresent embodiment. As illustrated in FIG. 14A, the template order isgiven to each of the numbered template images in descending order of thecharacteristic amount. The process of Steps S306 to S311 illustrated inFIG. 12 is executed for the template images based on the orderdetermined at Step S305, starting from the template image having thehighest rank.

Referring to FIG. 12, at Step S306, the imaging system 10 calculates atemporary position for the template image of interest as the target ofthe process. FIG. 14B is a diagram illustrating a first calculationmethod of the temporary position of a template image based on theordering, executed by the temporary position calculation unit 238according to the present embodiment. In the first calculation method, ajoint position is first obtained that is set to a peripheral templateimage positioned in the neighborhood of the template image of interest.

In the present embodiment, template images are generated for a row inthe overlapped region in the θ direction, and assigned template numbersfrom the left side; and hence, an adjacent relationship can bedistinguished by the numbers. In the example illustrated in FIG. 14B,joint positions are obtained for template images (assigned the numbers 2and 4 in the figure), which are positioned before and after the templateimage of interest (assigned the number 3 in the figure). Each of thetemplate images has been assigned the template order at Step S305 inFIG. 12, and the process of Steps S306 to S311 in FIG. 12 to detect ajoint position are executed starting from a template image having thehigher rank. Therefore, the joint positions have been already determinedfor the template images having the greater characteristic amounts andhigher ranks than the template image of interest.

Therefore, in the example in FIG. 14B, as the template image of interest(number 3) has the third rank, the joint positions have been alreadydetermined for the template images of the first and second templateranks (assigned the number 4 and the number 1). On the other hand, thejoint positions have not been determined for the template images of thefourth to sixth template rank (assigned the numbers 2, 5, and 6) asillustrated in reversal in FIG. 14B, to which the initial joint positionof (0, 0) is set. Note that the joint position of the template image ofinterest (number 3) is set to the initial joint position (0, 0) for themoment. The joint position represents a shift amount between thecoordinates of the template image in the overlapped region of thecorrected image 1 and the coordinates of the corresponding region in theoverlapped region of the corrected image 0. The joint position (0, 0)means that the template image is jointed at the coordinate position inthe corrected image 1 as it is.

Therefore, in the example in FIG. 14B, as the joint positions of theperipheral template images, the determined joint position of thetemplate image (number 4 in the figure) on the right side of thetemplate image of interest (number 3 in the figure), and the initialjoint position of the template image (number 2 in the figure) at theleft side are obtained.

Next, the joint positions of the obtained peripheral template images maybe averaged to set the average value as the temporary position of thetemplate of interest. At this moment, a simple arithmetic mean may becalculated as the average. Preferably, a weighted average may becalculated by giving different weights to a determined joint positionand an undetermined joint position (initial joint position),respectively. Specifically, the weight of a determined joint positionmay be set greater so that it has a greater influence.

The temporary position (tx_(i), ty_(i)) of a template image of interest(number i) may be calculated by Formula (3) below. In Formula (3),(x_(i−1), y_(i−1)) represents the joint position of the template image(number i−1) at the left side, w⁻ represents its weight, (x_(i+1),y_(i+1)) represents the joint position of the template image (i+1) atthe right side, and w₊ represents its weight. w⁻ or w₊ is a weightrepresenting whether the joint position of the adjacent template imageis undetermined or determined.

$\begin{matrix}{{{{tx}_{i} = \frac{{w_{-} \times x_{i - 1}} + {w_{+} \times x_{i + 1}}}{w_{-} + w_{+}}},{{ty}_{i} = \frac{{w_{-} \times y_{i - 1}} + {w_{+} \times y_{i + 1}}}{w_{-} + w_{+}}}}{w_{-} = \left\{ {{\begin{matrix}w_{H} & {{if}\mspace{14mu} \left( {x_{i - 1},x_{i - 1}} \right)\mspace{14mu} {IS}\mspace{14mu} {DETERMINED}} \\w_{L} & {{if}\mspace{14mu} \left( {x_{i - 1},x_{i - 1}} \right)\mspace{14mu} {IS}\mspace{14mu} {NOT}\mspace{14mu} {DETERMINED}}\end{matrix}w_{+}} = \left\{ \begin{matrix}w_{H} & {{if}\mspace{14mu} \left( {x_{i - 1},x_{i + 1}} \right)\mspace{14mu} {IS}\mspace{14mu} {DETERMINED}} \\w_{L} & {{if}\mspace{14mu} \left( {x_{i + 1},x_{i + 1}} \right)\mspace{14mu} {IS}\mspace{14mu} {NOT}\mspace{14mu} {DETERMINED}}\end{matrix} \right.} \right.}} & (3)\end{matrix}$

In the example in FIG. 14B, assuming that, for example, the weightcoefficient w_(H) is “0.7”, the weight coefficient for the undeterminedW_(L) is “0.3”, the joint position of the determined template number 4is (2, −2), and the joint position of the undetermined template number 2is the initial value (0, 0), then, the temporary position of thetemplate image of interest (number 3) is (1.4, −1.4) by Formula (3).

FIG. 14C is a diagram illustrating a second calculation method of thetemporary position of a template image based on the ordering, executedby the temporary position calculation unit 238 according to the presentembodiment. In the second calculation method illustrated in FIG. 14C,first, for each peripheral template image of the template image ofinterest, the distance from the template image of interest and the setjoint position are obtained. For those having joint positionsundetermined, the initial joint position (0, 0) is obtained as above.The distance between template images may be simply measured units ofblock numbers. For example, the template in interest has the templatenumber 3 in FIG. 14C. Therefore, it has the distance 1 to the templateimages of the numbers 2 and 4, the distance 2 to the template images ofthe number 1 and 5, and the distance 3 to the template images of thenumber 6.

Next, the joint positions of the obtained peripheral template images maybe averaged using the distances as weights to set the average value asthe temporary position of the template of interest. For weighting basedon the distance, a function may be used that takes a greater value for asmaller distance. For example, the reciprocal of the distance(l/distance) may be used as the weight.

Denoting the temporary position of the template image of interest(number i) by (tx_(i), ty_(i)), the joint positions of the templateimages by (x_(j), y_(j)) (number j=1 to N), and the distances by D_(ij),the temporary position (tx_(i), ty_(i)) can be calculated by Formula (4)below. Using the second calculation method illustrated in FIG. 14C,joint positions of template images other than immediately adjacent onesare taken into consideration. Therefore, continuity with the peripheralimages can be favorably maintained. Note that although it is assumedthat the distance and joint position is obtained for every peripheraltemplate image of the template image of interest, template images havinga predetermined distance or greater may be excluded.

$\begin{matrix}{{{tx}_{i} = \frac{\sum\limits_{j}\left( {x_{j} \times \frac{1}{D_{ij}}} \right)}{\sum\limits_{j}\left( \frac{1}{D_{ij}} \right)}},{{ty}_{i} = \frac{\sum\limits_{j}\left( {y_{j} \times \frac{1}{D_{ij}}} \right)}{\sum\limits_{j}\left( \frac{1}{D_{ij}} \right)}}} & (4)\end{matrix}$

Note that, in the above description, the weight is used to representwhether the adjacent template image has an undetermined or determinedjoint position, or to represent the distance between template images.However, the calculation method is not limited to those described above,which are just examples. Other embodiments may execute weighting thatdepends on whether the adjacent template image has an undetermined ordetermined joint position, and the distance between template images.

Referring to FIG. 12 again, at Step 3307, the imaging system 10 sets asearch range in the search region where template matching is to beexecuted. FIGS. 15A-15C are diagrams illustrating a setting method of asearch range executed by the search range setting unit 240 according tothe present embodiment. Template matching cuts off a search regionhaving a predetermined size in the search image for the template imageof interest. The image 0 for position detection as the search image andthe image 1 for position detection as the template image have beengenerated by the conversion table for position detection defined inadvance, and hence, they are superposed with a certain level ofprecision. Therefore, it is expected that a part corresponding thetemplate image is found in the neighborhood of the correspondingcoordinates in the corrected image 0, and a search region is cut offusing the coordinates as references. The search range is a range wheretemplate matching is executed. Matching with the image of the searchregion is executed by shifting the position of the template imagevertically and horizontally within the search range. Therefore, theprocess time gets longer when the search range is greater.

FIG. 15A illustrates a setting method of a usual search range where asearch region 330 having the initial position (a white circle 332equivalent to the coordinates of the template image) at the center isset as the search range 360A as it is. In this case, the search region330 is equivalent to the search range 360A, and matching calculationneeds to be executed all over the search region 330.

In contrast to this, FIG. 15B illustrates a setting method where asearch range is set based on a calculated temporary position. Usually, adetermined temporary position (denoted by a black circle in the FIG. 334is moved from the initial position (denoted by a white circle in theFIG. 332 due to an influence of a characteristic template. Therefore,the search region is moved (350) around the temporary position 334(black circle) as the center to set a region overlapped with theoriginal search region 330 as a search range 360B, which makes thesearch range narrower and the process time shorter.

FIG. 15C illustrates a setting method where a search range is set basedon a determined joint position of an adjacent template image. Similarlyto the method illustrated in FIG. 15B, the search region is moved (350)around the determined joint position (black circle) as the center toobtain a region overlapped with the original search region 330. Next,referring to the determined joint position of the adjacent templateimage, a search range 360C is determined, which is further narroweddown. For example, if the joint positions of adjacent template images atboth sides are determined, the joint position of the template ininterest may be in the range between those. Therefore, as in FIG. 15C,using the joint positions 336U and 336L in the vertical direction of thetemplate images at both sides, the search range 360B is restricted inthe vertical direction, and the process time is further shortened.

Referring to FIG. 12 again, at Step S308, the imaging system 10calculates matching by shifting the template image in the verticaldirection and the lateral direction in the search range set at Step S307within the search region, to obtain a score of similarity.

In the following, a zero-mean normalized cross-correlation (ZNCC) methodwill be described as an example of template matching with reference toFIGS. 16A-16B. FIG. 16A illustrates a template image; and FIG. 16Billustrates a process of searching for a template image in a searchrange by pattern matching. Here, N represents the total number of pixelsin a template (=W pixels×H pixels), and (kx, ky) represents a searchposition in the search range. Denoting the brightness at coordinates (i,j) in the template image by T(i, j), and the brightness in a searchimage by S(kx+i, ky+j) when the search position (kx, ky) is set to thereference coordinates (0, 0), matching score M(kx, ky) by the ZNCCmethod can be obtained by Formula (5) below. Note that although thesearch position (kx, ky) is set at the upper left of the template imagein FIGS. 16A-16B, the coordinates are not specifically limited, but maybe set at the center of the template image.

$\begin{matrix}{{M\left( {{kx},{ky}} \right)} = \frac{\begin{matrix}{{N{\sum\limits_{j}{\sum\limits_{i}{{S\left( {{{kx} + i},{{ky} + j}} \right)}T\left( {i,j} \right)}}}} -} \\{\sum\limits_{j}{\sum\limits_{i}{{S\left( {{{kx} + i},{{ky} + j}} \right)} \times {\sum\limits_{j}{\sum\limits_{i}{T\left( {i,j} \right)}}}}}}\end{matrix}}{\sqrt{\begin{matrix}{\left( {{N{\sum\limits_{j}{\sum\limits_{i}\left\{ {S\left( {{{kx} + i},{{ky} + j}} \right)} \right\}^{2}}}} - \left\{ {\sum\limits_{j}{\sum\limits_{i}{S\left( {{{kx} + i},{{ky} + j}} \right)}}} \right\}^{2}} \right) \times} \\\left( {{N{\sum\limits_{j}{\sum\limits_{i}\left\{ {T\left( {i,j} \right)} \right\}^{2}}}} - \left\{ {\sum\limits_{j}{\sum\limits_{i}{T\left( {i,j} \right)}}} \right\}^{2}} \right)\end{matrix}}}} & (5)\end{matrix}$

If the score M(kx, ky) is 1, it is complete matching, or if the score is−1, it is a negative-positive reversal. A higher score M(kx, ky)indicates higher similarity with the template image. As illustrated inFIG. 16B, template matching is executed by shifting the template imagevertically and horizontally within the search range, and matching scoreM(kx, ky) is calculated at each search position.

Note that the ZNCC method mentioned above can absorb fluctuation of thegain of an image, and can absorb fluctuation of the average brightnessof image. Although the ZNCC method is favorable in these points, thecalculation method of the score M(kx, ky) is not limited to the ZNCCmethod. Other embodiments may adopt an SSD (Sum of Square Difference)method, an SAD (Sum of Absolute Difference) method, a ZSSD (Zero-meanSum of Square Difference) method, a ZSAD (Zero mean Sum of AbsoluteDifference) method, an NCC (Normalized Cross-Correlation) method, or thelike.

Referring to FIG. 12 again, at Step S309, the imaging system 10 appliesan offset correction to the matching score M(kx, ky) based on thesimilarity at each position calculated at Step S308 to calculate acorrected final score. At Step S310, the imaging system 10 determinesthe joint position for the template image of interest based on thecorrected score at each position calculated at Step S309.

FIG. 17A illustrates a graph of an offset function for the matchingscore plotted for search positions (kx, ky). At Step S309, an offsetvalue is added to the matching score M(kx, ky) depending on the distancefrom the temporary position by an offset function (kx, ky) asillustrated in FIG. 17A. The offset function illustrated in FIG. 17A isa function in which the offset value is maximum at the temporaryposition, and monotonically decreases while the distance to thetemporary position gets greater. The offset function may be definedbased on the range of possible values of the matching score M. FIGS.17B-17C illustrate graphs of scores before and after correction plottedwith search positions, along with a matching position based on the scorebefore correction and a matching position based on the score aftercorrection. FIG. 17B illustrates an example of a template image having agreater characteristic amount whereas FIG. 17C illustrates an example ofa template image having a smaller characteristic amount.

As illustrated in FIG. 17B, by the offset correction, the final matchingscore is raised around the temporary position as the center. However,when the characteristic amount of the template image is great, thesimilarity greatly fluctuates due to the change of the position, andinfluence on the matching score by the similarity strongly remains.Therefore, regardless of the offset correction, a position at which thematching score based on the similarity is maximum is generallydetermined as the matching position. Namely, if the characteristicamount is great enough to be clearly maintained as the peak of thematching score of the similarity, the similarity dominantly determinesthe joint position.

On the other hand, as illustrated in FIG. 17C, if the characteristicamount of the template image is small, a usual matching score does nothave a clear peak, and the distance from the temporary position hasgreater influence than the matching score based on the similarity.Therefore, a position in the neighborhood of the temporary positionwhere the offset function takes the maximum value is generallydetermined as the matching position. Namely, if the characteristicamount is small, the temporary position dominantly determines the jointposition.

Once the matching position is determined, the joint position is obtainedas a shift amount (Δθ_(i), Δφ_(i)) from the position where the templateimage of interest (number i) is superposed at the coordinates of thecorrected image for position detection 0 as it is.

Due to the offset correction, if the score based on the similarity has aclear peak, and the similarity is great, the position is set as thejoint position. If there are no characteristic and no clear peak, aposition in the neighborhood of the temporary position is set as thejoint position, with which continuity with the adjacent block is kept,and a risk is reduced in that the joint position is determined at aposition far away from the temporary position.

Referring to FIG. 12 again, at Step S311, the imaging system 10determines whether all blocks of template images have been processed. Ifit is determined that not all blocks have been processed (NO) at StepS311, the process loops back to Step S306 to complete the process forall blocks. On the other hand, if it is determined that all blocks havebeen processed (YES) at Step S311, the process goes forward to StepS312.

By the process of Steps S306 to S311, the joint position (Δθ_(i),Δφ_(i)) is obtained for every one of the generated multiple templateimages (number i where i=1 to #). At Step S312, the imaging system 10calculates the joint position (Δθ, Δφ) for each pixel (θ, φ) in theentire celestial sphere format based on the data set of joint positionscorresponding to the obtained template images, and generates detectionresult data 222. At Step S313, the imaging system 10 ends the jointposition detection process, and goes back to the process illustrated inFIG. 5.

FIG. 18 is a diagram illustrating a data structure of detection resultdata generated by the joint position detection unit 204 according to thepresent embodiment. FIGS. 19A-19B are diagrams illustrating a process togenerate the detection result data by the joint position detection unit204 according to the present embodiment. By Step S312, the detectionresult data 222 as illustrated in FIG. 1 s obtained that holdscoordinates after conversion (θ, φ) associated with the shift amount(Δθ, Δφ) for all coordinates. In this case, the shift amount (Δθ, Δφ)corresponding to coordinates (θ, φ) can be calculated by setting andinterpolating the shift amount (Δθ_(i), Δφ_(i)) of the template block(i) obtained by the joint position detection process as the value of thecenter coordinates of the template block.

Specifically, first, as illustrated in FIG. 19A, the shift amount (Δθ,Δφ) is set to (0, 0) for coordinates whose θ coordinate in thehorizontal direction is equal to the coordinate of the center of thetemplate block, and positioned at the upper end (φ=0) and the lower end(φ=1799 if the height is 1800 pixels). For coordinates to which theshift amounts have not been set, as illustrated in FIG. 19B, a latticeis formed by four points (denoted A to D in the figure) having the shiftamounts set, and the shift amount is calculated by two-dimensionallinear interpolation in the lattice. Assuming that point Q internallydivides the four-point lattice by dθ:1-dθ in the θ axis direction, anddφ:1-dφ in the φ axis direction, the shift amount (Δθ_(Q), Δφ_(Q)) atpoint Q can be calculated using the shift amounts of the neighboringfour points ((Δθ_(A), Δφ_(A)), . . . , (Δθ_(D), Δφ_(D))) by Formula (6)below.

$\begin{matrix}\left. \begin{matrix}{{{\Delta \; \theta_{Q}} = {{\left( {1 - {d\; \varphi}} \right) \times \left( {{\left( {1 - {d\; \theta}} \right) \times \Delta \; \theta_{A}} + {d\; \theta \times \Delta \; \theta_{B}}} \right)} +}}\;} \\{d\; \varphi \times \left( {{\left( {1 - {d\; \theta}} \right) \times \Delta \; \theta_{C}} + {d\; \theta \times \Delta \; \theta_{D}}} \right)} \\{{\Delta \; \varphi_{Q}} = {{\left( {1 - {d\; \varphi}} \right) \times \left( {{\left( {1 - {d\; \theta}} \right) \times \Delta \; \varphi_{A}} + {d\; \theta \times \Delta \; \varphi_{B}}} \right)} +}} \\{d\; \varphi \times \left( {{\left( {1 - {d\; \theta}} \right) \times \Delta \; \varphi_{C}} + {d\; \theta \times \Delta \; \varphi_{D}}} \right)}\end{matrix} \right\} & (6)\end{matrix}$

Note that, in the present embodiment, the shift amount (0, 0) is set tothe upper end (φ=0) and the lower end (φ=1799 in the example) in theentire celestial sphere format. However, the calculation method of theshift amount (Δθ, Δφ) at coordinates (θ, φ) is not specifically limitedto the above. It is sufficient here to piece partial images 0 and 1together without inconsistency. Therefore, other embodiments may executethe two-dimensional linear interpolation by setting the shift amount (0,0) to coordinates positioned further internally. In this case, allcoordinates at the outside of the internal coordinates in the φdirection may be set to have the shift amount (0, 0).

Referring to FIG. 5 again, at Step S203, the imaging system 10 has thetable correction unit 206 correct the conversion table for positiondetection 220 using the detection result data 222 to adjust the positionof an image in the spherical surface coordinates system. As illustratedin FIG. 18, the shift amount is obtained for every pair of coordinatesin the entire celestial sphere image format by the joint positiondetection process at Step S202. At Step S203, specifically, thedistortion correction table for detection 0 used for distortioncorrection of the partial image 0 is corrected so that input coordinates(θ, φ) are associated with (x, y), which has been associated with (θ+Δθ,φ+Δφ) before correction. Note that distortion correction table fordetection 1 used for distortion correction of the partial image 1 doesnot need to be changed for the association.

At Step S204, the imaging system 10 has the table generation unit 208generate a conversion table for image synthesis 224 from the correctedconversion table for position detection 220 by applying rotationalcoordinate transformation to it.

FIG. 20 is a flowchart of a generation process of a conversion table forimage synthesis executed by the imaging system 10 according to thepresent embodiment. FIG. 21 is a diagram illustrating a mapping of twopartial images onto a spherical coordinate system where the images arecaptured by two fisheye lenses during an image synthesis process. Theprocess illustrated in FIG. 20 is called at Step S204 illustrated inFIG. 5, and starts at Step S400. In a loop of Steps S401 to S406, thetable generation unit 208 executes a process of Steps S402 to S405 foreach pair of coordinates (θ_(g), φ_(g)) in the spherical coordinatesystem for image synthesis, which is input into the distortioncorrection table for image synthesis. The ranges of coordinates to beset are defined by the entire range of horizontal angles (0 to 360°) andthe entire range of vertical angles (0 to 180°). To execute theconversion process for all coordinates to be input, coordinates arearranged in order here.

At Step S402, the table generation unit 208 calculates coordinates(θ_(d), φ_(d)) in the spherical coordinates system corresponding tocoordinates (θ_(g), φ_(g)) by rotational transform. By the rotationalcoordinate transformation, axes are changed from those defined by thehorizontal angle θ_(d) around the optical axis of one of the lensoptical systems, and the coordinates axis of the vertical angle θ_(d) asillustrated in FIG. 9, into axes defined by the horizontal angle θ_(g)having the axis perpendicular to the optical axis as a reference and thevertical angle φ_(g) as illustrated in FIG. 21. The coordinates (θ_(d),φ_(d)) corresponding to the coordinates (θ_(g), φ_(g)) can be calculatedbased on the rotational coordinate transformation by Formula (7) below,using the radius vector of 1, three-dimensional Cartesian coordinates(x_(g), y_(g), z_(g)) corresponding to coordinates (θ_(g), φ_(g)) in thespherical coordinate system for image synthesis, and three-dimensionalCartesian coordinates (x_(d), y_(d), z_(d)) corresponding to coordinates(θ_(d), φ_(d)) in the spherical coordinate system for positiondetection. Note that, in Formula (7), a coefficient β is a rotationangle that specifies the rotational coordinate transformation around thex-axis in the three-dimensional Cartesian coordinates, which is 90° inthe present embodiment.

$\begin{matrix}\left. \begin{matrix}{x_{g} = {{\sin \left( \varphi_{g} \right)}{\cos \left( \theta_{g} \right)}}} \\{y_{g} = {{\sin \left( \varphi_{g} \right)}{\sin \left( \theta_{g} \right)}}} \\{z_{g} = {\cos \left( \varphi_{g} \right)}} \\{\begin{pmatrix}x_{d} \\y_{d} \\z_{d}\end{pmatrix} = {\begin{pmatrix}1 & 0 & 0 \\0 & {\cos \; \beta} & {\sin \; \beta} \\0 & {{- \sin}\; \beta} & {\cos \; \beta}\end{pmatrix}\begin{pmatrix}x_{g} \\y_{g} \\z_{g}\end{pmatrix}}} \\{\varphi_{d} = {{Arc}\; {\cos \left( z_{d} \right)}}} \\{\theta_{d} = {{Arc}\; {\tan \left( \frac{y_{d}}{x_{d}} \right)}}}\end{matrix} \right\} & (7)\end{matrix}$

In the conversion table for position detection 220, the optical axis isprojected onto a pole of the spherical surface, and the overlapped partbetween images is projected onto the neighborhood of the equator of thespherical surface. Therefore, the top-bottom direction in the entirecelestial sphere image format is not coincident with the zenithdirection of a captured scene. In contrast to this, by the rotationalcoordinate transformation, in the conversion table for image synthesis224, the optical axis is projected onto the equator of the sphericalsurface, and hence, the top-bottom direction in the entire celestialsphere image format is coincident with the zenith direction of thecaptured scene.

In the loop of Steps S403 to S405, the table generation unit 208executes Step S404 for the image 0 and the image 1, respectively. AtStep S404, the table generation unit 208 obtains, for the images 0 and1, coordinates (x, y) of the partial image (0, 1) that can be associatedwith (θ_(d), φ_(d)) with reference to the corrected conversion table forjoint position detection. Note that the conversion tables 220 and 224hold coordinates (x, y) for both θ_(d) and φ_(d) by units of pixelsalthough coordinates (θ_(d), φ_(d)) calculated by conversion aretypically obtained with floating-point values. Simply, coordinates (x,y) in the partial image (0, 1) may be set to coordinates (x, y)associated with coordinates existing in the closest neighborhood of thecalculated coordinates (θ_(d), φ_(d)) in the table. Also, in a favorableembodiment, coordinates (x, y) of the partial image (0, 1) to beassociated may be calculated by executing weighted interpolationdepending on the distance from calculated coordinates (θ_(d), φ_(d))with reference to multiple coordinates (x, y) that are associated withthe closest coordinates and the surrounding coordinates among thoseexisting in the table.

When calculation has been done for both images (0, 1) in the loop ofSteps S403 to S405, and calculation has been completed for allcoordinates values to be input in the loop of Steps S402 to S406, theprocess ends at Step S407. Thus, all data are generated in theconversion table for image synthesis 224.

Referring to FIG. 5 again, at Step S205, the imaging system 10 has thedistortion correction unit for image synthesis 210 execute distortioncorrection for the original partial image 0 and partial image 1 usingthe conversion table for image synthesis 224 to obtain the correctedimage for image synthesis 0 and the corrected image for imagesynthesis 1. Thus, as a result of the process by the distortioncorrection unit for image synthesis 210, two partial images 0-1 capturedby the fisheye lenses are expanded on the entire celestial sphere imageformat as illustrated in FIG. 21. The partial image 0 captured by thefisheye lens 0 is typically mapped on the left hemisphere in the entirecelestial sphere, and the partial image 1 captured by the fisheye lens 1is typically mapped on the right hemisphere in the entire celestialsphere fisheye lens 1.

It can be clearly understood by comparing FIG. 9 and FIG. 21 that thepartial image 0 and partial image 1 are mapped at different positions inthe entire celestial sphere format, and the zenith direction of thescene is coincident with the φ direction, which is the top-bottomdirection of the image. The center parts of the partial images 0 and 1are mapped onto the equator having less distortion, and the overlappedregion between the corrected image and the corrected image 1 is mapped,differently from that illustrated in FIG. 9, onto the neighboringregions at the vertical angles of 0° and 180°, and the horizontal anglesof 0° and 180°.

At Step S206, the image synthesis unit 212 synthesizes the correctedimage for image synthesis 0 and the corrected image for imagesynthesis 1. In the synthesis process, a blend process or the like isexecuted for the overlapped region between images. For a region wherepixel values exist only in one of the images, those pixel values areadopted as they are. By the synthesis process, a single entire celestialsphere image is generated from two partial images captured by fisheyelenses.

As described above, in the present embodiment, the characteristic amountis measured that indicates a degree of characteristic held by a templateimage to be processed for matching, and using the measuredcharacteristic amount, joint positions of the template images aredetermined. Thus, regions having greater characteristic amounts areprioritized to be pieced together to improve the quality of an entirecelestial sphere image to be obtained. Namely, regions having greatercharacteristic amounts are prioritized to be pieced together, and theirjoint positions are referred to when regions having smallercharacteristic amounts are pieced together. Thus, even if an image isflat, or it is a region where the same pattern is repeated with fewcharacteristics, it is possible to detect a joint position with highprecision, which improves the quality of the entire celestial sphereimage to be obtained. Also, if multiple candidates of joint positionsexist just by using the similarity for a case where the same pattern isrepeated, by referring to joint positions of adjacent characteristicregions, the joint position can be uniquely determined.

Moreover, the algorithm can be simplified because a calculation processis not adopted that excludes an inappropriate matching region having asmaller characteristic amount. Also, the entire celestial sphere imagingsystem 10 deals with the omniazimuth imaging range. Therefore, it isoften the case that the overlapped region includes scenes that are flatand not suitable for piecing together such as the sky. Thepiecing-together process of multiple images according to the presentembodiment can be favorably used for piecing together the entirecelestial sphere image having such properties.

Second Embodiment

A second embodiment of the present invention will be described below,focusing on parts that are different from the previous embodiment.

The second embodiment has a matching calculation unit 242 that isdifferent from the one included in the configuration illustrated in FIG.10 for the previous embodiment. For the template image of interest, thematching calculation unit 242 typically calculates matching between thetemplate image of interest and parts in the corrected image for positiondetection based on the calculated temporary position by typically usinga template matching method. When calculating the matching, a templateimage is moved in the search range centered around the temporaryposition set by the search range setting unit 240, and a matching scoreis calculated that is an evaluation value based on similarity of theimages at positions. Further in the present embodiment, multipleevaluation methods are provided for ranges of the characteristic amountof the template image. Then, the matching calculation unit 242 in thepresent embodiment calculates the matching score by switching thematching evaluation methods depending on the characteristic amountcalculated by the template characteristic amount calculation unit 234.

For the template image of interest, the score correction unit 244executes an offset correction for the score based on the similarity ofthe images calculated by the matching calculation unit 242, to make thescore higher around the calculated temporary position. Note that therange of scores may differ depending on the used evaluation method.Therefore, the score correction unit 244 switches the offset correctionmethod depending on the evaluation method used by the matchingcalculation unit 242. In this way, the temporary position calculatedbased on the relative relationship of the characteristic amounts betweenthe template images is taken into account when calculating the score,and correction of the score can be done that is appropriate for thematching evaluation method.

Next, the matching calculation process will be described in detailaccording to the present embodiment using FIGS. 24A-24B. FIG. 24A is aflowchart illustrating details of the matching calculation processexecuted by the imaging system 10 according to the present embodiment.The process illustrated in FIG. 24A is called at Step S308 illustratedin FIG. 12, and starts at Step S600. At Step S601, the imaging system 10determines whether the characteristic amount of the template image ofinterest is greater than or equal to a predetermined threshold value.Also, in the present embodiment, the predetermined threshold value isdefined to segment the characteristic amount according to whether it isgreater or less than the threshold value. If the characteristic amountof the template image of interest is determined to be greater than orequal to the predetermined threshold value (YES) at Step S601, theprocess branches to Step S602.

At Step S602, the imaging system 10 calculates the matching score by anevaluation method suitable for an image having a great characteristicamount. The process ends at Step S604, and the process illustrated inFIG. 12 is resumed. On the other hand, if the characteristic amount ofthe template image of interest is determined not to be greater than orequal to the predetermined threshold value (NO) at Step S601, theprocess branches to Step S603. At Step S603, the imaging system 10calculates the matching score by an evaluation method suitable for animage having a small characteristic amount. The process ends at StepS604, and the process illustrated in FIG. 12 is resumed.

In the following, a Zero-mean Normalized Cross-Correlation (ZNCC) methodand a Zero-mean Sum of Squared Differences (ZSSD) method are describedas examples of template matching with reference to FIGS. 16A-16B shownabove. FIG. 16A illustrates a template image; and FIG. 16B illustrates aprocess of searching for a template image in a search range by patternmatching. Here, N represents the total number of pixels in a template(=W pixels×H pixels), and (kx, ky) represents a search position in thesearch range. Denoting the brightness at coordinates (i, j) in thetemplate image by T(i, j), and the brightness in a search image byS(kx+i, ky+j) when the search position (kx, ky) is set to the referenceby the e coordinates (0, 0), matching score M(kx, ky) by the ZNCC methodcan be obtained by Formula (8) below. Note that although the searchposition (kx, ky) is set at the upper left of the template image inFIGS. 16A-16B, the coordinates are not specifically limited, but may beset at the center of the template image.

$\begin{matrix}{{{ZNCC}\left( {{kx},{ky}} \right)} = \frac{\begin{matrix}{{N{\sum\limits_{j = 0}^{h - 1}{\sum\limits_{i = 0}^{w - 1}{{S\left( {{{kx} + i},{{ky} + j}} \right)}{T\left( {i,j} \right)}}}}} -} \\{\sum\limits_{j = 0}^{h - 1}{\sum\limits_{i = 0}^{w - 1}{{S\left( {{{kx} + i},{{ky} + j}} \right)} \times {\sum\limits_{j = 0}^{h - 1}{\sum\limits_{i = 0}^{w - 1}{T\left( {i,j} \right)}}}}}}\end{matrix}}{\sqrt{\begin{matrix}{\left( {{N{\sum\limits_{j = 0}^{h - 1}{\sum\limits_{i = 0}^{w - 1}\left\{ {S\left( {{{kx} + i},{{ky} + j}} \right)} \right\}^{2}}}} - \left\{ {\sum\limits_{j = 0}^{h - 1}{\sum\limits_{i = 0}^{w - 1}{S\left( {{{kx} + i},{{ky} + j}} \right)}}} \right\}^{2}} \right) \times} \\\left( {{N{\sum\limits_{j = 0}^{h - 1}{\sum\limits_{i = 0}^{w - 1}\left\{ {T\left( {i,j} \right)} \right\}^{2}}}} - \left\{ {\sum\limits_{j = 0}^{h - 1}{\sum\limits_{i = 0}^{w - 1}{T\left( {i,j} \right)}}} \right\}^{2}} \right)\end{matrix}}}} & (8)\end{matrix}$

The matching score ZNCC(kx, ky) represents the similarity. If it is 1,it is complete matching, or if the score is −1, it is anegative-positive reversal. A higher matching score ZNCC(kx, ky)indicates higher similarity with the template image. As illustrated inFIG. 16B, template matching is executed by shifting the template imagevertically and horizontally within the search range, and the matchingscore ZNCC(kx, ky) is calculated at each search position.

In contrast to this, a difference ZSSD(kx, ky) by the ZSSD method can beobtained by Formula (9) below. Note that the ZSSD method obtains the sumof squares of differences of brightness of the pixels at the sameposition. Therefore, a value obtained by the ZSSD method represents adifference, and a greater value means less similarity. Therefore, tomake it a score based on the similarity, the negative sign is attachedto use −ZSSD(kx, ky) as the matching score.

$\begin{matrix}{{{ZSSD}\left( {{kx},{ky}} \right)} = {\frac{\sum\limits_{j = 0}^{h - 1}{\sum\limits_{i = 0}^{w - 1}\left\{ {S\left( {{{kx} + i},{{ky} + j}} \right)} \right\}^{2}}}{N} - \frac{\left\{ {\sum\limits_{j = 0}^{h - 1}{\sum\limits_{i = 0}^{w - 1}{S\left( {{{kx} + i},{{ky} + j}} \right)}}} \right\}^{2}}{N^{2}} + \frac{\sum\limits_{j = 0}^{h - 1}{\sum\limits_{i = 0}^{w - 1}\left\{ {T\left( {i,j} \right)} \right\}^{2}}}{N} - \frac{\left\{ {\sum\limits_{j = 0}^{h - 1}{\sum\limits_{i = 0}^{w - 1}{T\left( {i,j} \right)}}} \right\}^{2}}{N^{2}} - {\quad{2\begin{bmatrix}{\frac{\sum\limits_{j = 0}^{h - 1}{\sum\limits_{i = 0}^{w - 1}{{S\left( {{{kx} + i},{{ky} + j}} \right)}{T\left( {i,j} \right)}}}}{N} -} \\\frac{\sum\limits_{j = 0}^{h - 1}{\sum\limits_{i = 0}^{w - 1}{{S\left( {{{kx} + i},{{ky} + j}} \right)} \cdot {\sum\limits_{j = 0}^{h - 1}{\sum\limits_{i = 0}^{w - 1}{T\left( {i,j} \right)}}}}}}{N^{2}}\end{bmatrix}}}}} & (9)\end{matrix}$

Assuming a pixel value is an 8-bit value, the matching score −ZSSD(kx,ky) can take values in the range of −(255×255) to 0, and if it is 0, itis complete matching. A higher matching score −ZSSD(kx, ky) indicateshigher similarity with the template image.

The ZNCC method described above can absorb fluctuation of gain of animage, can absorb fluctuation of average brightness of an image, and ithas robustness for matching the similarity, which makes the ZNCC methodfavorable. The ZNCC method can be used especially when brightness of animage has sufficiently wide distributions and the characteristic amountis great. In contrast to this, the ZSSD method is better than the SSD(Sum of Squared Differences) method in that the ZSSD method can absorbfluctuation of average brightness of an image. The ZSSD has a greatercalculation cost than the SSD method, but the calculation is simplerthan that of the ZNCC method. The ZSSD method can be favorably usedespecially for a fuzzy image having a small characteristic amount. Notethat a Zero-mean Sum of Absolute Differences (ZSAD) method may be usedinstead of the ZSSD method.

Referring to FIG. 12 again, at Step S309, the imaging system 10 appliesan offset correction to the matching score ZNCC(kx, ky) or −ZSSD(kx, ky)based on the similarity at each calculated position at Step S308 tocalculate a corrected final score.

FIG. 24B is a flowchart illustrating details of the score correctionprocess executed by the imaging system 10 according to the presentembodiment. The process illustrated in FIG. 24B is called at Step S309illustrated in FIG. 12, and starts at Step S700. At Step S701, theimaging system 10 determines whether the characteristic amount of thetemplate image of interest is greater than or equal to a predeterminedthreshold value. If the characteristic amount of the template image ofinterest is determined to be greater than or equal to the predeterminedthreshold value (YES) at Step S701, the process branches to Step S702.In this case, the ZNCC method is used for calculating the score.Therefore, the imaging system 10 uses an offset function for the ZNCCmethod to calculate the offset at Step S702. The process ends at StepS704, and the process illustrated in FIG. 12 is resumed.

On the other hand, if the characteristic amount of the template image ofinterest is determined not to be greater than or equal to thepredetermined threshold value (NO) at Step S701 (NO) the processbranches to Step S703. In this case, the ZSSD method is used forcalculating the score. Therefore, the imaging system 10 uses an offsetfunction for the ZSSD method to calculate the offset at Step S703. Theprocess ends at Step S704, and the process illustrated in FIG. 12 isresumed.

At Step S310, the imaging system 10 determines the joint position forthe template image of interest based on the corrected score at eachcalculated position at Step S309.

FIG. 17A illustrates a graph of an offset function for the matchingscore plotted for search positions (kx, ky). At Step S309, an offsetvalue is added to the matching score M(kx, ky) depending on the distancefrom the temporary position by an offset function (kx, ky) asillustrated in FIG. 17A. The offset function illustrated in FIG. 17A isa function in which the offset value is maximum at the temporaryposition, and monotonically decreases while the distance to thetemporary position gets greater. The offset function may be definedbased on the range of possible values of the matching score M. FIGS.17B-17C illustrate graphs of scores before and after corrections areplotted with search positions, along with a matching position based onthe score before correction and a matching position based on the scoreafter correction. FIG. 17B illustrates an example of a template imagehaving a greater characteristic amount whereas FIG. 17C illustrates anexample of a template image having a smaller characteristic amount.

As described above, in the present embodiment, the characteristic amountis measured that indicates a degree of characteristic held by a templateimage to be processed for matching, and using the measuredcharacteristic amount, joint positions of the template images aredetermined. Thus, regions are pieced together by an appropriateevaluation method to improve the quality of an entire celestial sphereimage to be obtained. More specifically, the evaluation method forobtaining a matching score is switched depending on the characteristicof a region. Thus, joint positions can be determined based on theevaluation methods appropriate for regions having greater characteristicamounts and regions having smaller characteristic amounts, respectively.Therefore, errors in joint position detection can be reduced, and theprecision of position matching can be improved. In addition, even if animage is flat, or it is a region where the same pattern is repeated withfew characteristics, it is possible to detect a joint position with highprecision, which improves the quality of the entire celestial sphereimage to be obtained. Moreover, the algorithm can be simplified becausea calculation process is not adopted that excludes an inappropriatematching region having a smaller characteristic amount.

Comparing the ZNCC method with the ZSSD method, the ZNCC method hashigher precision in general. However, in the embodiment described above,it is controlled to use the ZNCC method basically while the ZSSD methodis used for an image having a weak characteristic region, especially fora flat image. Advantages to use of the ZSSD method for a weakcharacteristic image instead of the ZNCC method will be described below.

For example, assume that matching evaluation is executed for a flatimage such as the blue sky or a white wall. Such a flat image typicallyincludes noise mixed when the image was captured. When executingmatching evaluation between flat images having noise, compared to theZNCC method that gives a kind of a so-called “correlation value”, theZSSD method that gives an error difference value as the sum of errordifferences of pixels calculates a moderate error difference betweennoisy images, which is a favorable value as the matching evaluationvalue. In the embodiment described above, desiring to get a favorablevalue as the matching evaluation value as a matching evaluation valuefor a flat image, the ZSSD method that gives the error difference valueis used for a template image having a small characteristic amount,instead of the ZNCC method that gives the correlation value.

The entire celestial sphere imaging system deals with the omniazimuthimaging range. Therefore, it is highly likely that the overlapped regionincludes scenes that are flat and not suitable for piecing together suchas the sky. The piecing-together process of multiple images according tothe present embodiment can be favorably used for piecing together theentire celestial sphere image having such properties.

Third Embodiment

In the embodiments described above, examples of an image processingapparatus and an imaging system are described using the imaging system10 that captures still pictures of an entire celestial sphere by imagingoptical systems provided in it, and synthesizes a final image by adistortion correction/image synthesis block in its inside. However, theconfiguration of the image processing apparatus and the imaging systemis not specifically limited to the above. It may be configured as anentire celestial sphere moving picture imaging system to capture movingpictures of the entire celestial sphere, or as a camera processor togenerate an entire celestial sphere image (still picture or movingpicture) when receiving multiple partial images (still picture or movingpicture) captured by multiple imaging optical systems as input.Alternatively, an information processing apparatus such as a personalcomputer, a workstation, or a virtual machine on a physical computersystem, or a portable information terminal such as a smart phone or atablet, may be configured as the above image processing apparatus thatreceives as input multiple partial images (still picture or movingpicture) captured by an entire celestial sphere imaging device used onlyfor imaging, to synthesize an entire celestial sphere image (stillpicture or moving picture). Also, an imaging system may be configuredthat includes an image processing apparatus such as the cameraprocessor, the information processing apparatus, or the portableinformation terminal as described above, and an imaging optical systemseparated from the image processing apparatus.

In the following, a third embodiment will be described with reference toFIGS. 22-23 where an entire celestial sphere imaging system includes anentire celestial sphere imaging device that captures multiple partialimages, and an external computer device to generate a synthesized entirecelestial sphere image when receiving the multiple partial images asinput. FIG. 22 is an overall view of the entire celestial sphere imagingsystem 400 according to the present embodiment.

The entire celestial sphere imaging system 400 illustrated in FIG. 22according to the third embodiment is constituted with an entirecelestial sphere imaging device 410 used only for imaging, and acomputer device 430 connected with the entire celestial sphere imagingdevice 410 and used only for image processing. Note that only mainelements are illustrated in FIG. 22, and details are omitted. Also, theelements having the same functions as those described with reference toFIG. 1 to FIG. 21 are assigned the same numerical codes. Also, theentire celestial sphere imaging system 400 in the example illustrated inFIGS. 22-23 has substantially the same configuration as the embodimentsdescribed with reference to FIGS. 1-21 except that image processing tosynthesize an entire celestial sphere image is solely executed on thecomputer device 430. Therefore, different points will be mainlydescribed in the following.

In the example illustrated in FIG. 22, the entire celestial sphereimaging device 410 includes a digital still camera processor 100, a lensbarrel unit 102, and a triaxial acceleration sensor 120 connected withthe processor 100. The lens barrel unit 102 has the same configurationas that illustrated in FIG. 2, and the processor 100 has the sameconfiguration as that illustrated in FIG. 2.

The processor 100 includes ISPs 108, a USB block 146, a serial block158, and controls USB communication with the computer device 430connected via a USB connector 148. The serial block 158 is connectedwith a wireless NIC 160 to control wireless communication with thecomputer device 430 connected via a network.

The computer device 430 illustrated in FIG. 22 may be constituted with ageneral-purpose computer such as a desktop personal computer or aworkstation. The computer device 430 includes hardware components suchas a processor, a memory, a ROM, and a storage. In the exampleillustrated in FIG. 22, the computer device 430 includes a USB interface432 and a wireless NIC 434, and is connected with the entire celestialsphere imaging device 410 via a USB bus or a network.

The computer device 430 is configured to further include a distortioncorrection unit for position detection 202, a joint position detectionunit 204, a table correction unit 206, a table generation unit 208, adistortion correction unit for image synthesis 210, and an imagesynthesis unit 212, which are process blocks related to image synthesis.In the present embodiment, two partial images captured by multipleimaging optical systems of the lens barrel unit 102, and a conversiontable for position detection of the entire celestial sphere imagingdevice 410 are transferred to the external computer device 430 via theUSB bus or the network.

In the computer device 430, the distortion correction unit for positiondetection 202 applies distortion correction to partial images 0 and 1transferred from the entire celestial sphere imaging device 410 usingthe conversion table for position detection transferred along with theimages, to generate the corrected images for position detection 0 and 1.The joint position detection unit 204 detects joint positions betweenthe converted corrected images 0 and 1 to generate detection resultdata. The table correction unit 206 corrects the transferred conversiontable for position detection based on the detection result data. Thetable generation unit 208 generates a conversion table for imagesynthesis by applying rotational coordinate transformation to thecorrected conversion data.

As a preprocess of an image synthesis process, the distortion correctionunit for image synthesis 210 applies a distortion correction to theoriginal partial image 0 and partial image 1 using the conversion tablefor image synthesis, and generates the corrected images for imagesynthesis 0 and 1. The image synthesis unit 212 synthesizes the obtainedcorrected image for images synthesis 0 and 1, and generates asynthesized image in the entire celestial sphere image format.

The functional block 430 illustrated in FIG. 4 may further include adisplay image generation unit 214. The display image generation unit 214executes image processing to project an entire celestial sphere image ona flat display device. The computer device 430 according to the presentembodiment implements the functional units described above and processesdescribed later under the control of the CPU, by reading a program fromthe ROM or HDD to load it in a work space provided by the RAM.

FIG. 23 is a flowchart of an entire celestial sphere image synthesisprocess as a whole executed by the entire celestial sphere imagingsystem 400 according to the present embodiment. FIG. 23 illustrates theflow after the entire celestial sphere imaging device 410 takes capturedimages as input until the images are stored in the computer device 430.

The process illustrated in FIG. 23 starts at Step S500, for example, inresponse to a pressing of the shutter button of the entire celestialsphere imaging device 410, which is a command to have the two imagingoptical systems execute imaging. First, the process in the entirecelestial sphere imaging device 410 is executed.

At Step S501, the entire celestial sphere imaging device 410 captures apartial image 0 and a partial image 1 by the two solid-state imagesensing devices 22A-22B. At Step S502, the entire celestial sphereimaging device 410 transfers the partial image 0 and partial image 1 tothe computer device 430 via the USB bus or the network. The conversiontable for position detection is also transferred to the computer device430 via the USB bus or the network. At this moment, if a slopecorrection is executed by the computer device 430, slope informationobtained by the triaxial acceleration sensor 120 is also transferred tothe computer device 430.

Note that the conversion table for position detection of the entirecelestial sphere imaging device 410 may be transferred when the entirecelestial sphere imaging device 410 and the computer device 430 firstrecognize each other. Namely, it is sufficient to transfer theconversion table for position detection to the computer device 430 once;the conversion table does not need to be transferred every time. Theconversion table for position detection is stored in, for example, anSDRAM (not illustrated) to be read out and transferred. The steps so farare executed in the process on the entire celestial sphere imagingdevice 410. Steps S503 and after are executed in the process on thecomputer device 430 where the images and table have been transferred.

At Step S503, the computer device 430 has the distortion correction unitfor position detection 202 apply distortion correction to thetransferred partial images 0 and 1 using the conversion table forposition detection to obtain corrected images for position detection 0and 1. At this moment, if a slope correction is executed by the computerdevice 430 based on the transferred slope information, a correction maybe applied in advance to the conversion table for position detection inthe vertical direction. At Step S504, the computer device 430 has thejoint position detection unit 204 execute joint position detection inthe overlapped region of the corrected images 0 and 1 to obtaindetection result data. At Step S505, the computer device 430 has thetable correction unit 206 correct the transferred conversion table forposition detection using the joint position detection result to adjustthe position of the images in the spherical coordinates system. At StepS506, the computer device 430 has the table generation unit 208 generatea conversion table for image synthesis from the corrected conversiontable for position detection by transforming coordinates by rotationaltransform.

At Step S507, the computer device 430 has the distortion correction unitfor image synthesis 210 apply distortion correction to the originalpartial images 0 and 1 using the conversion table for image synthesis toobtain corrected images for image synthesis 0 and 1. By the abovesynthesis process, an entire celestial sphere image is generated fromthe two partial images captured by the fisheye lenses. Then, at StepS509, the computer device 430 Step S508 saves the generated entirecelestial sphere image into an external storage, and the process ends atStep S510.

Note that the operations in the flowchart in the present embodimentillustrated in FIG. 23 can be executed by a program on a computer.Namely, the CPU controlling operations of the entire celestial sphereimaging device 410, and the CPU controlling operations of the computerdevice 430 read programs stored in a recording medium such as a ROM or aRAM to load them on respectively memories to implement respective partsof the entire celestial sphere image synthesis process described above.Note that FIG. 22 and FIG. 23 illustrate examples of the entirecelestial sphere image imaging system that is separately configured,which do not mean that embodiments are limited to those specificallyillustrated in FIG. 22 and FIG. 23. The functional units to implementthe entire celestial sphere image imaging system may be distributed tobe realized on one or more imaging devices and one or more computersystems in various ways.

By the embodiments described above, it is possible to provide an imageprocessing apparatus, an image processing method, a program, and animaging system that are capable of detecting appropriate joint positionswhen detecting joint positions between multiple input images.

Note that, in the embodiments described above, multiple partial imagesare captured at virtually the same time using different lens opticalsystems. Alternatively, in another embodiment, multiple partial imagesmay be captured by the same lens optical system at different timingsfrom a predetermined imaging position facing in different imagingdirections (azimuths) to be superposed. Moreover, in the embodimentsdescribed above, two partial images captured by lens optical systemshaving field angles greater than 180° are superposed to be synthesized.Alternatively, in another embodiment, three or more partial imagescaptured by one or more lens optical systems may be superposed to besynthesized. Also, in the embodiments described above, the imagingsystem using fisheye lenses are taken as an example to describe theembodiments, the embodiments may be used for an entire celestial sphereimaging system using superwide-angle lenses. Further, in the favorableembodiments described above, superposing of an entire celestial sphereimage is described, but the application is not limited to that. Theembodiments may be applied to any image processing process that needs todetect joint positions of multiple images.

Also, the functional units may be implemented by a computer-executableprogram written in a legacy programming language or an object orientedprogramming language such as, an assembler, C, C++, C#, Java(trademark), and may be stored in a machine-readable recording mediumsuch as a ROM, an EEPROM, an EPROM, a flash memory, a flexible disk, aCD-ROM, a CD-RW, a DVD-ROM, a DVD-RAM, a DVD-RW, a Blu-ray Disc, an SDcard, and an MO, to be distributed by the media or telecommunicationsline. Also, a part or all of the functional units may be implemented bya programmable device (PD), for example, a field programmable gate array(FPGA) or an ASIC (application specific IC), and may be distributedthrough the recording media as data described in an HDL (HardwareDescription Language) such as VHDL (Very High Speed Integrated CircuitsHardware Description Language) or Verilog-HDL to generate circuitconfiguration data to download the functional units on the PD to beimplemented on the PD circuit configuration data (bit stream data).

Further, the present invention is not limited to these embodiments andexamples described above, but various variations and modifications maybe made without departing from the scope of the present invention.

What is claimed is:
 1. An image processing apparatus detecting aplurality of joint positions between a plurality of input images,comprising: a target image generation unit configured to generate aplurality of target images to be searched in a second input image amongthe input images from a first input image among the input images; acharacteristic amount calculation unit configured to calculate acharacteristic amount for each of the target images generated by thetarget image generation unit; and a matching calculation unit configuredto calculate a matching between the target image of interest among thetarget images having the characteristic amounts calculated by thecharacteristic amount calculation unit, and a part of the second inputimage, using an evaluation method depending on the characteristicamounts calculated by the characteristic amount calculation unit.
 2. Theimage processing apparatus as claimed in claim 1, further comprising: anevaluation value correction unit configured to correct an evaluationvalue at each of positions calculated by the matching calculation unitusing a correction method depending on the evaluation method used by thematching calculation unit.
 3. The image processing apparatus as claimedin claim 2, further comprising: a temporary position calculation unitconfigured to calculate a temporary position for the target image ofinterest based on a relative relationship of the characteristic amountsbetween the target image of interest and one or more of the peripheraltarget images, wherein the evaluation value correction unit corrects theevaluation value based on similarity calculated by the matchingcalculation unit so that the evaluation value takes a greater valuecentered around the temporary position.
 4. The image processingapparatus as claimed in claim 1, wherein the characteristic amount is atleast one of an edge amount, dispersion and standard deviation of thetarget image.
 5. The image processing apparatus as claimed in claim 1,wherein, as the evaluation method depending on the characteristicamounts, an evaluation method giving a correlation value is used whenthe characteristic amount is greater than a reference value, or anotherevaluation method giving an error difference value is used when thecharacteristic amount is less than the reference value.
 6. The imageprocessing apparatus as claimed in claim 1, further comprising: a jointposition determination unit configured to determine the joint positionwith the second input image for the target image of interest, dependingon the joint positions of peripheral target images having thecharacteristic amounts greater than that of the target image ofinterest, based on the evaluation values calculated by the matching. 7.The image processing apparatus as claimed in claim 6, furthercomprising: a conversion unit configured to convert a plurality ofcaptured images onto a coordinate system different from a coordinatesystem used when capturing the captured images, using conversion data toproject an overlapped region where captured ranges of the capturedimages are overlapped, onto a neighborhood of the equator of a sphericalsurface based on a projection model, to generate the input images; acorrection unit configured to correct the conversion data based on ajoint position detection result by the joint position determinationunit; and a data generation unit configured to apply a rotationalcoordinate transform to the conversion data corrected by the correctionunit, to generate the conversion data for image synthesis specifyingconversion to be applied to the captured images for image synthesis. 8.An image processing method detecting a plurality of joint positionsbetween a plurality of input images, executed by a computer, the methodcomprising: generating a plurality of target images to be searched in asecond input image among the input images from a first input image amongthe input images; calculating a characteristic amount for each of thetarget images; calculating a matching between a target image of interestamong the target images, and a part of the second input image, using anevaluation method depending on the calculated characteristic amounts. 9.An image processing system detecting a plurality of joint positionsbetween a plurality of input images, comprising: an image capturingunit; an obtainment unit configured to obtain the input images from aplurality of captured images for a plurality of respective azimuthscaptured by the image capturing unit; a target image generation unitconfigured to generate a plurality of target images to be searched in asecond input image among the input images from a first input image amongthe input images; a characteristic amount calculation unit configured tocalculate a characteristic amount for each of the target imagesgenerated by the target image generation unit; and a matchingcalculation unit configured to calculate a matching between the targetimage of interest among the target images having the characteristicamounts calculated by the characteristic amount calculation unit, and apart of the second input image, using an evaluation method depending onthe characteristic amounts calculated by the characteristic amountcalculation unit.